package com.barbeque.mall.bean.wx.order;

import com.barbeque.mall.util.OptionStatus;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author Tezel
 * @since 2022/07/20 12:49
 */
@Data
public class WxOrderDetailOrderInfoVo {

    private Integer id;

    private String orderSn;

    private String orderStatusText;

    private Short aftersaleStatus;

    private String consignee;

    private String mobile;

    private String address;

    private String message;

    private OptionStatus handleOption;

    private BigDecimal goodsPrice;

    private BigDecimal freightPrice;

    private BigDecimal couponPrice;

    private BigDecimal actualPrice;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    private Date addTime;

    private String expCode;

    private String expName;

    private  String expNo;



    public String getOrderStatusText() {
        return orderStatusText;
    }

    public void setOrderStatusText(Short status) {
        if("101".equals(status.toString())){
            this.orderStatusText ="未付款";
        }

        if("201".equals(status.toString())){
            this.orderStatusText ="已付款";
        }

        if("202".equals(status.toString())){
            this.orderStatusText ="申请退款";
        }

        if("203".equals(status.toString())){
            this.orderStatusText ="已退款";
        }

        if("301".equals(status.toString())){
            this.orderStatusText ="已发货";
        }

        if("401".equals(status.toString())||
                "402".equals(status.toString()) ){
            this.orderStatusText ="用户收货";
        }

    }

    public WxOrderDetailOrderInfoVo(Integer id, String orderSn, Short aftersaleStatus, String consignee, String mobile, String address, String message, BigDecimal goodsPrice, BigDecimal freightPrice, BigDecimal couponPrice, BigDecimal actualPrice, Date addTime, String expCode, String expNo) {
        this.id = id;
        this.orderSn = orderSn;
        this.aftersaleStatus = aftersaleStatus;
        this.consignee = consignee;
        this.mobile = mobile;
        this.address = address;
        this.message = message;
        this.goodsPrice = goodsPrice;
        this.freightPrice = freightPrice;
        this.couponPrice = couponPrice;
        this.actualPrice = actualPrice;
        this.addTime = addTime;
        this.expCode = expCode;
        this.expNo = expNo;
    }

    public WxOrderDetailOrderInfoVo() {
    }

}
